import { request } from "@/utils/axios"


/**
 * 机构获取学生列表  默认分页10条记录
 */
export function GetInformationApi(params) {
    return request(
        {
            url: "/institution/getStudents",
            method: "GET",
            params: params,
        }
    );
}

/**
 * 根据学生id获取学生基本信息
 */
export function GetStudentInfoApi(params) {
    return request(
        {
            url: "/institution/getStudentInfo",
            method: "GET",
            params: params,
        }
    );
}

/**
 * 参赛选手录入  |   修改学生基本信息
 */
export function PlayerEntryApi(data) {
    return request(
        {
            url: "/institution/playerEntry",
            method: "POST",
            data: data,
        }
    );
}

/**
 * 删除参赛选手
 */
export function DeleteStudentApi(params) {
    return request(
        {
            url: "/institution/deleteStudent",
            method: "DELETE",
            params: params,
        }
    );
}


/**
 * 添加/编辑 指导老师
 */
export function AddTeacherApi(data) {
    return request(
        {
            url: "/institution/addTeacher",
            method: "POST",
            data: data,
        }
    );
}

/**
 * 删除指导老师
 */
export function DeleteTeacherApi(params) {
    return request(
        {
            url: "/institution/deleteTeacher",
            method: "DELETE",
            params: params,
        }
    );
}

/**
 * 获取指导老师
 */
export function GetTeachersApi(params) {
    return request(
        {
            url: "/institution/getTeachers",
            method: "GET",
            params: params,
        }
    );
}

// -------------------------------------------------------- 赛事
/**
 * 获取赛项分页
 */
export function GetEventsApi(params) {
    return request(
        {
            url: "/institution/getEvents",
            method: "GET",
            params: params,
        }
    );
}
/**
 * 获取赛项分组
 */
export function GetGroupsApi() {
    return request(
        {
            url: "/institution/getGroups",
            method: "GET",
        }
    );
}
/**
 * 获取赛项分组 部分关联的
 */
export function GetGroupsDownApi() {
    return request(
        {
            url: "/institution/getGroupsDown",
            method: "GET",
        }
    );
}

/**
 * 获取已经报名的学生分页列表 即状态为 2 3 4的学生 说明处于 已报名待审核|已审核待绑定|已绑定
 */
export function GetRegisteredStudentsApi(params) {
    return request(
        {
            url: "/institution/getRegisteredStudents",
            method: "GET",
            params: params,
        }
    );
}
/**
 * 机构保存基本信息
 * saveInformationForInstitution
 */
export function SaveInformationForInstitutionApi(data) {
    return request(
        {
            url: "/institution/saveInformationForInstitution",
            method: "POST",
            data: data,
        }
    );
}


/**
 * 获取已参加的赛事列表
 */
export function GetAlreadyEventsListPageApi(params) {
    return request(
        {
            url: "/institution/getAlreadyEventsListPage",
            method: "GET",
            params: params,
        }
    );
}



/**
 * 获取未报名的学生分页列表    即报名状态为1的学生  说明学生未进行参赛报名
 */
export function GetNotRegisteredStudentsApi(params) {
    return request(
        {
            url: "/institution/getNotRegisteredStudents",
            method: "GET",
            params: params,
        }
    );
}


/**
 * 通过赛项id 获取详情
 */
export function GetEventInfoByEventIdApi(params) {
    return request(
        {
            url: "/institution/getEventInfoByEventId",
            method: "GET",
            params: params,
        }
    );
}

/**
 * 为学生绑定id码  并把参赛状态改为4  表示已绑定
 */
export function BindIdFroStudentApi(params) {
    return request(
        {
            url: "/institution/bindIdFroStudent",
            method: "PUT",
            params: params,
        }
    );
}

/**
 * 报名
 */
export function ApplicationApi(params) {
    return request(
        {
            url: "/institution/application",
            method: "PUT",
            params: params,
        }
    );
}


/**
 * 撤销报名
 * http://127.0.0.1:8080/agent/withdrawalRegistration?studentId=5&eventId=1
 */
export function WithdrawalRegistrationApi(params) {
    return request(
        {
            url: "/agent/withdrawalRegistration",
            method: "PUT",
            params: params,
        }
    );
}

/**
 * 获取机构列表 不分页 简单列表
 * @param {*} params 
 * @returns 
 */
export function GetInstitutionsApi(params) {
    return request(
        {
            url: "information/getInstitutions",
            method: "GET",
            params: params,
        }
    );
}

/**
 * 获取赛项列表 不分页 简单列表
 * /institution/getEventsNot?eventName=v
 * @param {*} params 
 * @returns 
 */
export function GetEventsNotApi(params) {
    return request(
        {
            url: "institution/getEventsNot",
            method: "GET",
            params: params,
        }
    );
}
